<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/4/1
 * Time: 10:27
 */

namespace Home\Controller;


use Think\Controller;

class CommonController extends Controller
{
    protected function _user($redirect = false)
    {
        if (empty($_SESSION['loginuser']) && $redirect) {
            $url = U('Account/login');
            IS_AJAX ? $this->error('请登录', $url) : redirect($url);
        }
        return $_SESSION['loginuser'];
    }
}